package com.job.sun;

/**
 * @author legion
 * @version 1.0
 * @since 2022-07-02 18:41:48
 */
public class MyTool {
    public static void main(String[] args) {

    }

    public static void bubble(int[] nums) {
        for (int j = 0; j < nums.length - 1; j++) {
            for (int i = 0; i < nums.length - 1; i++) {
                if (nums[i] < nums[i + 1]) {
                    int end = nums[i + 1];
                    nums[i + 1] = nums[i];
                    nums[i] = end;
                }
            }

        }

    }

    public static void select(int[] nums) {
        for (int i = 0; i < nums.length - 1; i++) {
            for (int j = 1 + i; j < nums.length; j++)
                if (nums[i] < nums[j]) {
                    int end = 0;
                    end = nums[j];
                    nums[j] = nums[i];
                    nums[i] = end;
                }
        }
    }

}